<?php
require_once($_SERVER['DOCUMENT_ROOT'] . '/all.conf.php');
require_once(__PHY_LIB.'/inc/page.inc.php');
require_once(__PHY_LIB.'/class/uWork.class.php');
require_once(__PHY_LIB.'/class/uCategory.class.php');
require_once(__PHY_LIB.'/class/uUser.class.php');
require_once(__PHY_LIB.'/class/uAd.class.php');

/// 最大的作品 ///
$oAd = new uAd();
$oAd->cfgWhere("location='homepage_ad_top'");
$oAd->cfgOrder("rank");
$oAd->load();
$oBestWork = new uWork($oAd->get('obj_id'));
$oBestWork->set('ad_img1_url', $oAd->get('img1_url'));
$oTpl->assign('rBestWork', $oBestWork->getData());

/// 类别路径 ///
$oCtgry = new uCategory($oBestWork->get('category_id'));
$oCtgry->set('BreadCrumb', $oCtgry->fetchBreadCrumb());
$oTpl->assign('rCtgry', $oCtgry->getData());

/// 优秀作品 ///
$oList = new uWorkList();
//? $oList->cfgWhere("");
$oList->cfgOrder("id DESC");
$oList->load(10);
while ($oOne = $oList->nextItem()) {
	$oOne->getSku(0, 0, true);
}
$oTpl->assign('rGoodWorks', $oList->fetchArray());

$oTpl->display(dirname(__FILE__).'/'.basename(__FILE__, '.php').'.tpl');
?>
